import { Random } from "mockjs"; // 导出随机函数
import Mock from "mockjs";

function getBelongCity(req: any) {
  let data = Mock.mock({
    "data|1-6": [
      {
        id: "1",
        name: "@cname()",
        pictureUrl: "",
        description: "",
        price: "@Integer()",
        belongCity: "",
        cityId: "",
      },
    ],
  });

  return {
    success: true,
    message: "注册成功",
    code: "200",
    data: data.data,
  };
}

function getCity(req: any) {
  let data = Mock.mock({
    "data|2": [
      {
        id: "1",
        cityName: "@cname()",
        "scenicSpots|2-9": [
          {
            id: "2",
            name: "@cname()",
            pictureUrl: "",
            description: "",
            price: "@Integer(3,44)",
            belongCity: "",
            cityId: "4",
          },
        ],
      },
    ],
  });

  return {
    success: true,
    message: "注册成功",
    code: "200",
    data: data.data,
  };
}

export default {
  getBelongCity,
  getCity,
};
